"""f210112 f21010512 白彬彬"""
import cv2

# 加载图像
image = cv2.imread("E:\photo\Ex01_building.jpg")
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

# 创建SIFT对象
sift = cv2.SIFT_create()

# 检测特征点
keypoints = sift.detect(gray_image, None)

# 绘制特征点
image_with_keypoints = cv2.drawKeypoints(gray_image, keypoints, None, flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)

# 显示图像
cv2.imshow('Image with Keypoints', image_with_keypoints)
cv2.waitKey(0)
cv2.destroyAllWindows()